package org.example.service.userservices;

import org.example.entity.user;
import org.example.mapper.usermapper;
import org.example.service.userservice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class userserviceimpl implements userservice {

    @Autowired
     usermapper usermapper; //成员变量

    @Override
    public void insert(user student) {
        usermapper.insert(student);
    }

    @Override
    public void delete(user student) {
        usermapper.delete(student);
    }

    @Override
    public void update(user student) {
        usermapper.update(student);
    }

    @Override
    public user selectById(int id) {
        user student = usermapper.selectById(id);
        return student;
    }

    @Override
    public List<user> selectAll() {
        List<user> students = usermapper.selectAll();
        return students;
    }
}
